package createpattern.prototype.shallowcopy;

public class Citation implements Cloneable{

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void show() {
        System.out.println(name + "同学：在2024学年第一学期中表现优秀，被评为三好学生。");
    }

    @Override
    protected Citation clone() throws CloneNotSupportedException {
        return (Citation) super.clone();
    }

    public static void main(String[] args) throws CloneNotSupportedException {
        Citation c1 = new Citation();
        c1.setName("张三");

        Citation c2 = c1.clone();
        c2.setName("李四");

        c1.show();
        c2.show();
    }
}
